<?php

namespace app\admin\validate\member;

use ShidianUtil\Thinkphp\Validate\BaseValidate;

/**
 * Class LawyerDraftCheck
 * @package app\member\validate
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037623
 */
class LawyerDraftCheck extends BaseValidate
{

    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id'	=> 'isId',
		'memberId'	=> 'integer|max:11',
		'checkStatus'	=> 'integer|egt:0|max:1',
		'realname'	=> 'scalar|max:30',
		'provinceId'	=> 'integer|egt:0|max:11',
		'cityId'	=> 'integer|egt:0|max:11',
		'practiceNumber'	=> 'scalar|max:60',
		'practicingLawFirm'	=> 'scalar|max:200',
		'certificatePic'	=> 'scalar|max:200',
		'practiceTime'	=> 'likeId',
		'headImgUrl'	=> 'scalar|max:200',
		'introduce'	=> 'scalar|max:600',
		'lawFirmAdd'	=> 'scalar|max:200',
		'chargingStandard'	=> 'scalar|max:200',
		'updated'	=> 'integer|egt:0|max:11',
		'created'	=> 'integer|egt:0|max:11',
        'page'      => 'integer|egt:0|max:11',
        'page_size' => 'integer|egt:0|max:11',
    ];

    protected $field = [
        'id'	=> 'id',
		'memberId'	=> 'memberId',
		'checkStatus'	=> 'checkStatus',
		'realname'	=> 'realname',
		'provinceId'	=> 'provinceId',
		'cityId'	=> 'cityId',
		'practiceNumber'	=> 'practiceNumber',
		'practicingLawFirm'	=> 'practicingLawFirm',
		'certificatePic'	=> 'certificatePic',
		'practiceTime'	=> 'practiceTime',
		'headImgUrl'	=> 'headImgUrl',
		'introduce'	=> 'introduce',
		'lawFirmAdd'	=> 'lawFirmAdd',
		'chargingStandard'	=> 'chargingStandard',
		'updated'	=> 'updated',
		'created'	=> 'created',
        'page'      => '分页页数',
        'page_size' => '分页大小',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id.require'	=> '缺少:attribute',
		'id.isId'	=> '请设置正确的:attribute',
		'memberId.require'	=> '请输入:attribute',
		'memberId.integer' => ':attribute应该是整数',
		'memberId.max'	=> ':attribute长度不能超过:rule位',
		'checkStatus.require'	=> '请输入:attribute',
		'checkStatus.integer' => ':attribute应该是整数',
		'checkStatus.egt'	=> ':attribute应该大于等于:rule',
		'checkStatus.max'	=> ':attribute长度不能超过:rule位',
		'realname.require'	=> '请输入:attribute',
		'realname.scalar' => ':attribute应该是字符串',
		'realname.max'	=> ':attribute长度不能超过:rule位',
		'provinceId.require'	=> '请输入:attribute',
		'provinceId.integer' => ':attribute应该是整数',
		'provinceId.egt'	=> ':attribute应该大于等于:rule',
		'provinceId.max'	=> ':attribute长度不能超过:rule位',
		'cityId.require'	=> '请输入:attribute',
		'cityId.integer' => ':attribute应该是整数',
		'cityId.egt'	=> ':attribute应该大于等于:rule',
		'cityId.max'	=> ':attribute长度不能超过:rule位',
		'practiceNumber.require'	=> '请输入:attribute',
		'practiceNumber.scalar' => ':attribute应该是字符串',
		'practiceNumber.max'	=> ':attribute长度不能超过:rule位',
		'practicingLawFirm.require'	=> '请输入:attribute',
		'practicingLawFirm.scalar' => ':attribute应该是字符串',
		'practicingLawFirm.max'	=> ':attribute长度不能超过:rule位',
		'certificatePic.require'	=> '请输入:attribute',
		'certificatePic.scalar' => ':attribute应该是字符串',
		'certificatePic.max'	=> ':attribute长度不能超过:rule位',
		'practiceTime.require'	=> '请选择:attribute',
		'practiceTime.isId'	=> '请选择正确的:attribute',
		'headImgUrl.require'	=> '请输入:attribute',
		'headImgUrl.scalar' => ':attribute应该是字符串',
		'headImgUrl.max'	=> ':attribute长度不能超过:rule位',
		'introduce.require'	=> '请输入:attribute',
		'introduce.scalar' => ':attribute应该是字符串',
		'introduce.max'	=> ':attribute长度不能超过:rule位',
		'lawFirmAdd.require'	=> '请输入:attribute',
		'lawFirmAdd.scalar' => ':attribute应该是字符串',
		'lawFirmAdd.max'	=> ':attribute长度不能超过:rule位',
		'chargingStandard.require'	=> '请输入:attribute',
		'chargingStandard.scalar' => ':attribute应该是字符串',
		'chargingStandard.max'	=> ':attribute长度不能超过:rule位',
		'updated.require'	=> '请输入:attribute',
		'updated.integer' => ':attribute应该是整数',
		'updated.egt'	=> ':attribute应该大于等于:rule',
		'updated.max'	=> ':attribute长度不能超过:rule位',
		'created.require'	=> '请输入:attribute',
		'created.integer' => ':attribute应该是整数',
		'created.egt'	=> ':attribute应该大于等于:rule',
		'created.max'	=> ':attribute长度不能超过:rule位',
        'page.require'      => '请输入:attribute',
        'page.integer'      => ':attribute应该是整数',
        'page.egt'          => ':attribute应该大于等于:rule',
        'page.max'          => ':attribute长度不能超过:rule位',
        'page_size.require' => '请输入:attribute',
        'page_size.integer' => ':attribute应该是整数',
        'page_size.egt'     => ':attribute应该大于等于:rule',
        'page_size.max'     => ':attribute长度不能超过:rule位',
    ];

    protected $scene = [
        'delete' => ['id' => 'require'],
        'index'  => ['page', 'page_size'],
        'read'   => ['id' => 'require'],
        'save'   => ['memberId', 'checkStatus', 'realname', 'provinceId', 'cityId', 'practiceNumber', 'practicingLawFirm', 'certificatePic', 'practiceTime', 'headImgUrl', 'introduce', 'lawFirmAdd', 'chargingStandard', 'updated', 'created'],
    ];

}
